<%@page contentType="text/html" import="java.util.Collection, Bean.*"%>
<%@page pageEncoding="UTF-8"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%
if(session.getAttribute("un")==null){
    response.sendRedirect("indexAdmin.jsp?page=Admin&url=Login");
    out.println("You must be login..!");
}else{%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
</head>
<body>

<form action="Searchexammark" method="get">
    <h3 align="center">Search Exam Marks</h3>
    <table border="0">
        <tr>
            <td  colspan="2">Student Rollno: 
            <input type="text" name="txtsearch" value="" /></td>
            <td><input type="submit" name="bt" value="Search"  /> <a href="indexAdmin.jsp?page=Admin&url=ExamMark">Back..!</a></td>
        </tr>
        <tr>
            <td>Button select Rollno have mark < 40:(Not Pass)</td>
            <td colspan="2"><input type="submit" name="bt" value="Rollno Marks" /></td>
        </tr>
    </table>
    <br>
    
    <c:if test="${not empty sear}">
        <table border="1">
        <tr>
            <th>Rollno</th>
            <th>SubID</th>
            <th>ExamTimes</th>
            <th>Marks</th>
            <th>Date Exam</th>
            <th colspan="2">Action</th>
        </tr>
        <c:forEach items="${sear}" var="s">
            <tr>
                <td><c:out value="${s.rollno}" /></td>
                <td>${s.subid}</td>
                <td>${s.examTime}</td>
                <td>${s.mark}</td>
                <td>${s.dateexam}</td>
                <c:url var="delete" value="Searchexammark">
                    <c:param name="bt" value="Delete" />
                    <c:param name="exameID" value="${s.id}" />
                    <c:param name="txtsearch" value="${param.txtsearch}"/>
                </c:url>
                <c:url var="edit" value="Searchexammark">
                    <c:param name="bt" value="Edit" />
                    <c:param name="exameID" value="${s.id}" />
                    <c:param name="examTime" value="${s.examTime}" />
                    <c:param name="mark" value="${s.mark}" />
                    <c:param name="dateexm" value="${s.dateexam}" />
                </c:url>
                <% if(session.getAttribute("permission")!=null){
                    if(session.getAttribute("permission").equals("Academic")){%>
                <td><a href="${edit}">Edit</a></td>
                <%    
                    }
                %>
                <% 
                if(session.getAttribute("permission").equals("Admin")){%>
                <td><a href="${edit}">Edit</a></td>
                <td><a href="${delete}" onclick="return confirm('Do you really want to delete these records ?')">Delete</a></td>
                <%    
                }
                %>
                <%}%>
            </tr>
        </c:forEach>
    </c:if>
    </table>
</form>

</body>
</html>
<%}%>